<template>
  <div class="app-container">
    <!-- <el-button type="primary">Create Device Group</el-button> -->

    <el-table :data="groups">
      <el-table-column
        label="group name"
        prop="groupName"
      >
        <template slot-scope="{row}">
            <router-link
              :to="{path:'/monitor/groups/' + row.groupName, query:{ groupName: row.groupName }}"
              class="text-highlight"
            >
              {{ row.groupName }}
            </router-link>
          </template>
      </el-table-column>

      <el-table-column
        label="device number"
        prop="deviceNum"
      ></el-table-column>

      <el-table-column
        label="create time"
        prop="createTime"
      ></el-table-column>
      
      <el-table-column
        label="creator"
        prop="creator"
      ></el-table-column>
    </el-table>
  </div>
  
</template>

<script>
export default {
  data() {
    return {
      groups: [
        {
          groupName: '江北新区流域',
          deviceNum: 5,
          createTime: '2020-04-20',
          creator: 'hanniko'
        },
        {
          groupName: 'test-group',
          deviceNum: 0,
          createTime: '2020-04-26',
          creator: 'hanniko'
        }
      ]
    }
  }
}
</script>

<style lang="scss">
.text-highlight {
  text-decoration: underline;
  &:link,
  &:visited {
    color: lightseagreen;
  }
}
</style>